home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / print / hpgl2ps.zip / PLOTDOT.C < prev    next >
C/C++ Source or Header  |  1989-08-08  |  746b  |  41 lines

  1. /* plotdot.c */
  2. /*
  3.  * Plot a dot or symbol on the paper 
  4.  */
  5. #include "defn.h"
  6.  
  7. plotdot(type)
  8. char   *type;
  9. {
  10.     end_draw();
  11.  
  12.     while (SIGNED_NUMERIC)
  13.     {
  14.     xval = getval() * XSCALE;
  15.     yval = getval() * YSCALE;
  16.     if (type == RMOVE)
  17.     {
  18.         absX += xval;
  19.         absY += yval;
  20.     } else
  21.     if (type == MOVE)
  22.     {
  23.         absX = xval + offX;
  24.         absY = yval + offY;
  25.     } else
  26.     {
  27.         fprintf(stderr, "Error: expecting move command not %s\n", type);
  28.         exit(1);
  29.     }
  30.  
  31.     if (SYMBOL)
  32.         printf("%g %g 5 %g (%c) Text\n", absX, absY, char_angle, symbl);
  33.         else if (SETDOT)
  34.     {
  35.             printf("newpath\n");
  36.             printf("  %g %g %s %g %g %s\n", absX, absY, MOVE, absX, absY, DRAW);
  37.         printf("stroke\n");
  38.     }
  39.     }
  40. }
  41.